# try:
#     li = [1, 2, 3, 4]
#     # li[4]  # 报错  我想把异常信息打印出来
# # except IndexError as e:  # e = IndexError
# #     print(e)
# #     print("hello")
# except Exception as e:
#     # 类的对象实例调用__class__属性时会指向该实例对应的类，而后再调用 __name__ 就会输出该实例对应的类的类名
#     print(e.__class__.__name__,":",e)
# else:
#     print('123')
#

try:
    li = [1, 2, 3, 4]
    li[4]  # 报错  我想把异常信息打印出来
# except IndexError as e:  # e = IndexError
#     print(e)
#     print("hello")
except Exception as e:
    # 类的对象实例调用__class__属性时会指向该实例对应的类，而后再调用 __name__ 就会输出该实例对应的类的类名
    print(e.__class__.__name__,":",e)
else:
    print('123')
finally:
    print('我最NB')
